
#include "PublicInclude.h"
#include <mysql.h>
#include <string>

#pragma comment (lib, "libmysql.lib")
#pragma comment (lib, "mysqlclient.lib")

using namespace std;

class sMysql
{
public:
	sMysql();
	~sMysql();
	
private:
	MYSQL mysqlData;
	static char* uer;
	static char* password;
	static sMysql* mysql;
public:
	static sMysql* getInstance();
	bool init();
	bool linkMySql(char* host,char* username,char* password,char* db,int port);
	bool insertRecord(char* tableName,char* rowSet,char* rowValueSet);
	bool deleteRecord(char* tableName,char* rowName,char* value);
	bool modifyRecord(char* talbleName,char* newRowName,char* newValue,char* oldRowName,char* oldValue);
	MYSQL_RES* inquiryRecord(char* tableName,char* queryRowName,char* rowName,char* rowvalue);
	MYSQL_RES* inquiryMaxRecord(char* tableName,char* rowName);
	char* str_link_str(char* first_str,char* second_str);

	bool createTalbe();
};